class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.z: F = None
        self.y: F = None
        self.w: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

g = A("g")
m = B("m")
b = C("b")
k = D("k")
l = E("l")
c = F("c")

g.u = l
m.s = b
m.u = b
b.v = m
b.w = g
b.p = l
k.v = g
k.r = g
k.z = c
k.y = c
k.w = m
k.p = b
l.u = b
l.v = g
c.s = m
c.r = m
c.x = k
assert c.x.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.z: F = None
        self.y: F = None
        self.w: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

g = A("g")
m = B("m")
b = C("b")
k = D("k")
l = E("l")
c = F("c")

g.u = l
m.s = b
m.u = b
b.v = m
b.w = g
b.p = l
k.v = g
k.r = g
k.z = c
k.y = c
k.w = m
k.p = b
l.u = b
l.v = g
c.s = m
c.r = m
c.x = k
assert c.x.v.u.txt == "l"