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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: F = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.txt = txt

f = A("f")
n = B("n")
d = C("d")
g = D("g")
c = E("c")
m = F("m")
j = A("j")

f.x = d
f.y = c
f.r = g
f.v = g
f.s = g
f.w = n
n.s = g
n.x = c
d.q = n
d.t = m
g.w = d
g.v = f
c.u = m
c.r = m
c.y = d
m.o = j
m.w = c
j.x = d
j.y = c
j.r = g
j.v = g
j.s = g
j.w = n
assert j.y.y.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.r: D = None
        self.w: B = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: F = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.txt = txt

f = A("f")
n = B("n")
d = C("d")
g = D("g")
c = E("c")
m = F("m")
j = A("j")

f.x = d
f.y = c
f.r = g
f.v = g
f.s = g
f.w = n
n.s = g
n.x = c
d.q = n
d.t = m
g.w = d
g.v = f
c.u = m
c.r = m
c.y = d
m.o = j
m.w = c
j.x = d
j.y = c
j.r = g
j.v = g
j.s = g
j.w = n
assert j.y.y.q.x.txt == "c"