class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

k.p = g
k.v = l
m.v = j
m.q = j
m.p = j
m.w = c
m.r = c
c.s = j
c.t = i
g.y = j
g.u = i
g.x = k
g.p = k
g.v = c
g.r = m
i.p = j
j.x = l
l.y = j
l.u = i
l.x = k
l.p = k
l.v = c
l.r = m
assert l.v.t.p.x.y.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

k.p = g
k.v = l
m.v = j
m.q = j
m.p = j
m.w = c
m.r = c
c.s = j
c.t = i
g.y = j
g.u = i
g.x = k
g.p = k
g.v = c
g.r = m
i.p = j
j.x = l
l.y = j
l.u = i
l.x = k
l.p = k
l.v = c
l.r = m
assert l.v.t.p.x.y.x.u.txt == "i"